Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
heimdalljs-logger
Advanced tools
heimdalljs-logger is a logging utility designed to work with the heimdalljs performance monitoring library. It provides a simple and efficient way to log messages with different levels of severity, making it easier to track and debug performance issues in your application.
Basic Logging
Allows you to log messages with different levels of severity (info, warn, error).
const logger = require('heimdalljs-logger')('my-app');
logger.info('This is an info message');
logger.warn('This is a warning message');
logger.error('This is an error message');
Custom Log Levels
Enables you to define custom log levels for more granular control over logging.
const logger = require('heimdalljs-logger')('my-app');
logger.addLevel('debug', 1000);
logger.debug('This is a debug message');
Contextual Logging
Allows you to add contextual information to your log messages, making it easier to understand the context in which a log message was generated.
const logger = require('heimdalljs-logger')('my-app');
logger.info('Starting process', { processId: 12345 });
Winston is a versatile logging library with support for multiple transports (e.g., console, file, HTTP). It offers more advanced features like log formatting, log levels, and custom transports, making it a more comprehensive solution compared to heimdalljs-logger.
Bunyan is a simple and fast JSON logging library. It provides a straightforward API for logging and includes features like log levels, serializers, and log rotation. Bunyan's focus on JSON logging makes it a good choice for structured logging, which is not a primary focus of heimdalljs-logger.
Pino is a low-overhead logging library designed for high-performance applications. It offers features like log levels, serializers, and log redirection. Pino's emphasis on performance and low overhead makes it a suitable alternative to heimdalljs-logger for applications where logging performance is critical.
var logger = require('heimdalljs-logger')('foo');
logger.trace('trace message');
logger.debug('debug message');
logger.info('info message');
logger.warn('warn message');
logger.error('error message');
console.log('app message');
DEBUG=foo DEBUG_LEVEL=trace foo
# => trace message
# ... debug message
# ... info message
# ... warn message
# ... error message
# ... app message
foo
# => app message
DEBUG=foo DEBUG_LEVEL=warn foo
# => warn message
# ... error message
# ... app message
var heimdall = require('heimdalljs');
var config = require('heimdalljs').configFor('logging');
config.matcher = (id) => /hai/.test(id.name);
config.depth = 2;
var logger = require('heimdalljs-logger')('foo');
heimdall.start('a');
heimdall.start('bhai');
heimdall.start('c');
heimdall.start('dhai');
logger.warn('warn message');
// => foo [bhai -> dhai] warn message
FAQs
Structured logging via heimdalljs
The npm package heimdalljs-logger receives a total of 211,753 weekly downloads. As such, heimdalljs-logger popularity was classified as popular.
We found that heimdalljs-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.